<?php
/**
 * @version     1.0.0
 * @package     com_travel
 * @copyright   Copyright (C) 2013. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 * @author      thinh <dinhducthinh88@yahoo.com> - http://
 */


// No direct access
defined('_JEXEC') or die;

class TravelController extends JControllerLegacy
{
	protected $default_view = 'tours';
	
	public function display($cachable = false, $urlparams = false)
	{	
		$viewName	= JRequest::getCmd('view', 'tours');
		$layout 	= JRequest::getCmd('layout', 'default');
		$id			= JRequest::getInt('id');
		
		// Check for edit form.
		if ($viewName == 'tour' && $layout == 'edit' && !$this->checkEditId('com_travel.edit.tour', $id)) {
			// Somehow the person just went to the form - we don't allow that.
			$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
			$this->setMessage($this->getError(), 'error');
			$this->setRedirect(JRoute::_('index.php?option=com_travel&view=tours', false));
			return false;
		}
		parent::display($cachable, $urlparams);

		return $this;
	}
	
	
}